<<<<<<< HEAD
function[]=run_stft(wave_file)

[audioIn,fs]=audioread(wave_file);

[path, filename, extension] = fileparts(wave_file);


segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;

FFTLength = 512;
numBands = 50;

segmentSamples = round(segmentDuration * fs)
frameSamples = round(frameDuration * fs)
hopSamples = round(hopDuration * fs)
overlapSamples = frameSamples - hopSamples

win=hann(frameSamples,'periodic')
fn = strcat(filename,"-win.txt");
format short
writematrix(win,fn,'delimiter','tab')
fn = strcat(filename,"-data.txt");
writematrix(audioIn,fn,'delimiter','tab')
[s,f,t] = stft(audioIn,fs,Window=win,OverlapLength=overlapSamples,FFTLength=FFTLength,FrequencyRange='onesided');

fn = strcat(filename,"-stft.txt");
writematrix(s,fn,'delimiter','tab')
=======
function[]=run_stft(wave_file)

[audioIn,fs]=audioread(wave_file);

[path, filename, extension] = fileparts(wave_file);


segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;

FFTLength = 512;
numBands = 50;

segmentSamples = round(segmentDuration * fs)
frameSamples = round(frameDuration * fs)
hopSamples = round(hopDuration * fs)
overlapSamples = frameSamples - hopSamples

win=hann(frameSamples,'periodic')
fn = strcat(filename,"-win.txt");
format short
writematrix(win,fn,'delimiter','tab')
fn = strcat(filename,"-data.txt");
writematrix(audioIn,fn,'delimiter','tab')
[s,f,t] = stft(audioIn,fs,Window=win,OverlapLength=overlapSamples,FFTLength=FFTLength,FrequencyRange='onesided');

fn = strcat(filename,"-stft.txt");
writematrix(s,fn,'delimiter','tab')
>>>>>>> 4eba858 (bug fix and add test scripts)
end